package com.lamda.zhekou.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by MJiao on 9/3/14.
 */
@Controller
public class ErrorController {

    @RequestMapping(value = "/notFound", method = RequestMethod.GET)
    public String notFound(Model model) {

        model.addAttribute("title", "访问的页面不存在");

        return "error404";
    }

    @RequestMapping(value = "/serverError", method = RequestMethod.GET)
    public String serverError(Model model) {

        model.addAttribute("title", "服务器内部错误");

        //String ip = getLocalIP();
        System.exit(0);

        return "error500";
    }

}